#include<iostream>
#include<windows.h>
#include <thread>
#include <functional>

using namespace std;

#define FREQUENCE_TIME 1000

void clickPoint(LONG x, LONG y)
{
    POINT p;
    SetCursorPos(x, y);//更改鼠标坐标
    GetCursorPos(&p);//获取鼠标坐标
    std::cout << p.x << " " << p.y << std::endl;
    //SetPhysicalCursorPos(p.x - 300, p.y - 300);
    mouse_event(MOUSEEVENTF_LEFTDOWN, 0, 0, 0, 0);//按下左键
    mouse_event(MOUSEEVENTF_LEFTUP, 0, 0, 0, 0);//松开左键
    Sleep(FREQUENCE_TIME);
}

void thMoveMouse()
{
    POINT p;
//    while(1){
//        GetCursorPos(&p);//获取鼠标坐标
//        std::cout << p.x << " " << p.y << std::endl;
//        Sleep(100);
//    }
    while (1) {
        clickPoint(791, 187);
        clickPoint(650, 340);
        clickPoint(797, 695);
    }
}

int main()
{
    thread thLeft(thMoveMouse);
    thLeft.join();

    return 0;
}